<template>
  <a-row :gutter="24">
    <a-col :md="24">
      <a-card :style="cardStyle" :bordered="false">
        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
          <!-- 搜索区域 -->
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="24">
              <a-col :md="6" :sm="24">
                <a-form-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
                  <a-date-picker
                    style="width:100%"
                    v-model="queryParam.operTime"
                    date-format="YYYY-MM-DD"
                    placeholder="选择日期"
                    @change="onDateChange"
                    @ok="onDateOk"
                  />
                </a-form-item>
              </a-col>
              <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                <a-col :md="6" :sm="24">
                  <a-button type="primary" @click="searchQuery">查询</a-button>
                  <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
                </a-col>
              </span>
            </a-row>
          </a-form>
        </div>
        <!-- 操作按钮区域 -->
        <div class="table-operator"  style="margin-top: 5px">
          <a-button @click="myHandleAdd" type="primary" icon="plus">新增</a-button>
        </div>
        <!-- table区域-begin -->
        <div>
          <a-table
            ref="table"
            size="middle"
            bordered
            rowKey="id"
            :columns="columns"
            :dataSource="dataSource"
            :components="handleDrag(columns)"
            :pagination="ipagination"
            :scroll="scroll"
            :loading="loading"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
            @change="handleTableChange">
            <span slot="action" slot-scope="text, record">
              <a @click="myHandleView(record)">查看</a>
              <a-divider type="vertical" />
              <a-popconfirm title="确定删除吗?" @confirm="() => myHandleDelete(record)">
                <a>删除</a>
              </a-popconfirm>
            </span>
          </a-table>
        </div>
        <!-- table区域-end -->
        <!-- 表单区域 -->
        <shipu-out-day-modal ref="modalForm" @ok="modalFormOk" @close="modalFormClose"></shipu-out-day-modal>
        <shipu-out-day-modal-view ref="modalFormView" @ok="modalFormOk" @close="modalFormClose"></shipu-out-day-modal-view>
      </a-card>
    </a-col>
  </a-row>
</template>
<!-- create ji sheng hua-->
<script>
import ShipuOutDayModal from './modules/ShipuOutDayModal'
import ShipuOutDayModalView from './modules/ShipuOutDayModalView'
import BillExcelIframe from '@/components/tools/BillExcelIframe'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { BillListMixin } from './mixins/BillListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import JDate from '@/components/jeecg/JDate'

export default {
    name: "ShipuOutDayList",
    mixins:[JeecgListMixin,BillListMixin],
    components: {
      ShipuOutDayModal,
      ShipuOutDayModalView,
      BillExcelIframe,
      JEllipsis,
      JDate
    },
    data () {
      return {
        // 查询条件
        queryParam: {
        },
        prefixNo: 'LSCK',
        labelCol: {
          span: 5
        },
        wrapperCol: {
          span: 6,
          offset: 1
        },
        // 默认索引
        defDataIndex:['action','day','main','deputy'],
        // 默认列
        defColumns: [
          {
            title: '操作',
            dataIndex: 'action',
            align:"center", width: 60,
            scopedSlots: { customRender: 'action' },
          },
          { title: '日期', dataIndex: 'day',width:80},
          { title: '主菜数量', dataIndex: 'main',width:80},
          { title: '副菜数量', dataIndex: 'deputy',width:80}
        ],
        url: {
          list: "/shipuday/list",
          delete: "/shipuday/delete",
          deleteBatch: "/shipuday/deleteBatch",
          batchSetStatusUrl: "/shipuday/batchSetStatus"
        }
      }
    },
    computed: {
    },
    created () {
      this.initSystemConfig()
      this.getDepotData()
    },
    methods: {
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>